﻿@model Bieb.Web.Models.Stories.ViewStoryModel

<div class="panel panel-primary">
    <div class="panel-body">
        <h1>@Html.DisplayFor(model => model.Title)</h1>
        @if (Model.Subtitle != null)
        { 
            <h2>@Html.DisplayFor(model => model.Subtitle)</h2>
        }
        <ul>
            @if (Model.Book != null)
            {
                <li>@BiebResources.StoryStrings.From @Html.ActionLink(Model.Book.Text, "Details", new { id = Model.Book.Id, controller = "Books" })</li>
            }
            @if (Model.HasTags)
            { 
                <li>@BiebResources.SharedStrings.Tags: @Model.Tags</li>
            }
            @if (Model.Publisher != null)
            {
                <li>@BiebResources.SharedStrings.Publisher: @Html.ActionLink(Model.Publisher.Text, "Details", new { id = Model.Publisher.Id, controller = "Publishers" })</li>
            }
        </ul>

        @if (Model.ReferenceStory != null)
        {
            <h2>@BiebResources.SharedStrings.Original:</h2>
            <ul>
                @if (Model.Title != Model.ReferenceStory.Title)
                {
                    // No ActionLink yet, a page for a ReferenceStory is a bit too boring for that
                    <li>@BiebResources.SharedStrings.Title: @Model.ReferenceStory.Title</li>
                }
                @if (Model.ReferenceStory.Publisher != null)
                {
                    <li>
                        @BiebResources.SharedStrings.Publisher: 
                @Html.ActionLink(Model.ReferenceStory.Publisher.Text, "Details", new { id = Model.ReferenceStory.Publisher.Id, controller = "Publishers" })
                    </li>
                }
                @if (Model.ReferenceStory.Year.HasValue)
                {
                    <li>
                        @BiebResources.SharedStrings.Published:
                        <span>@Model.ReferenceStory.Year.Value</span>
                    </li>
                }
                @if (Model.ReferenceStory.HasLanguage)
                {
                    <li>
                        @BiebResources.SharedStrings.Language:
                        <span>@Model.ReferenceStory.Language</span>
                    </li>
                }
            </ul>
        }
    </div>
</div>
